<include file="Public:header"/>
<script type="text/javascript">
$(document).ready(function(){
	$('select[name="time_type"]').val('{$time_type}');
	$('select[name="kw_type"]').val('{$kw_type}');
	$('select[name="status"]').val('{$status}');
	if($('select[name="time_type"]').val() == 'custom'){
		$('.custom_time').show();
	}
	$('select[name="time_type"]').change(function () {
		time_type = $(this).val();
		if(time_type == 'custom'){
			$('.custom_time').show();
		}else{
			$('.custom_time').hide();
			$('input[name="start_date"]').val('');
			$('input[name="end_date"]').val('');
		}
	})
});
</script>
<div class="form_data">
	<form action="" method="get" filterValid="true">
	<div class="mod_name" id="no_pmb">
		<li class="on">
			搜索条件
		</li>
	</div>
	<div class="mod_data">
		<table width="100%" class="condition">
			<tr class="filter">
				<td width="45%" valign="top">
					
					<div>
						<span class="name">关键字：</span>
						<select name="kw_type">
							<option value="order_sn">订单号</option>
							<option value="lawyer_name">律师姓名</option>
							<option value="user_name">用户姓名</option>
							<option value="mobile">买家手机号</option>
							<option value="user_id">买家UserID</option>
						</select>
						<input type="text" name="k_word" value="{$k_word}" style="width:130px;"/>
					</div>
					<div>
						<span class="name">金额范围：</span>
						<input type="text" name="start_price" value="{$start_price}" style="width:80px;">
						-
						<input type="text" name="end_price" value="{$end_price}" style="width:80px;">
					</div>
					<div>
						<span class="name">服务名称</span>
						<input type="text" name="title" value="{$title}" style="width:130px;"/>
					</div>
				</td>
				<td valign="top">
					<div>
						<span class="name">订单状态：</span>
						<select name="status">
							<option value="">全部</option>
							<php>
								$order_status_list = C('user_order_status_desc');
							</php>
							<volist name="order_status_list" id="status_desc">
								<option value="{$key}">{$status_desc}</option>
							</volist>
						</select>
					</div>
					
					<div>
						<span class="name">订单类型：</span>
						{:W('Plugin/category_select', array('', 'category_id', 'agreement', 0, 0, 0))}
					</div>

					<div>
						<span class="name">交易时间：</span>
						<select name="time_type">
							<option value="">全部</option>
							<option value="today">今天</option>
							<option value="week">一周</option>
							<option value="month">一个月</option>
							<option value="3month">三个月</option>
							<option value="custom">自定义</option>
						</select>
						<span style="display: none" class="custom_time">
							<input type="text" name="start_date" id="start_date" value="{$start_date}" onclick="WdatePicker()" style="width:80px;">
							至
							<input type="text" name="end_date" id="end_date" value="{$end_date}" onclick="WdatePicker()" style="width:80px;">
						</span>
					</div>

				</td>
			</tr>
		</table>
		
	</div>
	<div class="mod_data">
		<button type="submit" class="btn btn-search">查询</button>
		<span class="btn btn-full-screen data-full-screen">全屏查看</span>
	</div>
	</form>
</div>
<div class="total">
	总订单数:<span class="price">{$total_num}</span>，
	今日新增：<span class="price">{$today_num}</span>
</div>
<div class="data_list">
	<table style="width:1500px;">
		<tr>
			<th>订单号</th>
			<th>类别</th>
			<th>UserID</th>
			<th>姓名</th>
			<th>手机号</th>
			<th>服务名称</th>
			<th>订单金额</th>
			<th>实付金额</th>
			<th>处理律师</th>
			<th>订单时间</th>
			<th>订单状态</th>
			<th width="250">操作</th>
		</tr>
		<volist name="list" id="rs">
		<tr>
			<td> {$rs['order_sn']} </td>
			<td> {$rs['category_name']} </td>
			<td> {$rs['user_id']} </td>
			<td> {$rs['user_name']} </td>
			<td> {$rs['user_mobile']} </td>
			<td> {$rs['title']} </td>
			<td> <span class="price">{$rs['order_amount']}</span> </td>
			<td> <span class="price">{$rs['payed_amount']}</span> </td>
			<td> 
				<notempty name="rs.lawyer_user_id">{$rs['lawyer_name']}({$rs['lawyer_mobile']})</notempty> 
			</td>
			<td> {$rs['datetime']} </td>
			<td style="color: {$rs['status_color']}"> {$rs['user_status_desc']} </td>
			<td>
				<eq name="rs.status" value="wait_pay">
					<a class="win" href="{:URL('win_help_pay', array('order_sn' => $rs['order_sn']))}">支付</a>
				</eq>
				<a class="noneAjax" href="{:URL('service_confirm', array('order_sn' => $rs['order_sn']))}" title="客服人员">
					<eq name="rs.status" value="doing-service">
						客服确认
					<else/>
						查看
					</eq>
				</a>
				<php>if(in_array($rs['status'], array('doing-audit', 'cancel', 'finish'))){</php>
				<a class="noneAjax" href="{:URL('audit_confirm', array('order_sn' => $rs['order_sn']))}" title="审核人员">
					<eq name="rs.status" value="doing-audit">
						审核
					<else/>
						查看
					</eq>
				</a>
				<php>}</php>
				<a class="win" href="{:URL('win_set_remark', array('order_sn' => $rs['order_sn']))}">
					备注
				</a>
				<eq name="rs.is_cancel" value="1">
					<a class="btn-confirm-opt noneAjax cancel-{$rs['order_sn']}" msg="您确定要取消此订单({$rs['order_sn']})" href="{:URL('cancel', array('order_sn' => $rs['order_sn']))}" del-class="cancel-{$rs['order_sn']}">
						取消订单
					</a>
				</eq>

				<a href="{:URL('del', array('order_sn' => $rs['order_sn']))}">删除订单</a>
			</td>
		</tr>
		</volist>
	</table>
</div>

<notempty name="page"><div class="page">{$page}</div></notempty>

<include file="Public:footer"/>